package com.haoshuang.zhouzhoubang.ui.page.order.contact

import com.haoshuang.zhouzhoubang.databinding.ItemContactWorkerBinding
import com.haoshuang.zhouzhoubang.model.bean.OrderWorkerBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.load
import com.mufeng.libs.utils.view.visibleOrGone


/**
 * 
 */
class ContactWorkerAdapter(data: MutableList<OrderWorkerBean>) : BaseBindingQuickAdapter<OrderWorkerBean, ItemContactWorkerBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: OrderWorkerBean?) {
        holder.getViewBinding<ItemContactWorkerBinding>().apply {

            if (item == null) return@apply
            tvLabel.text = if (item.team_team_leader == 1) "负责人" else "服务人员"
            tvLabel.visibleOrGone(position <= 1)
            viewLine.visibleOrGone(position > 1)

            rivHead.load(item.avatar)
            tvName.text = item.nickname
            tvPhone.text = item.phone

        }
    }

}